//
//  FPProfileInfoController.m
//  FinanceProject
//
//  Created by 陈显摆 on 2025/3/11.
//

#import "FPProfileInfoController.h"
#import "FPProfileInfoCell.h"
#import "FPProfileInfoHeaderView.h"

@interface FPProfileInfoController () <UITableViewDelegate , UITableViewDataSource>

@property (nonatomic , strong) FPProfileInfoHeaderView *headerView;

@end

@implementation FPProfileInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)initUI {
    
    self.view.backgroundColor = MAIN_VIEW_BACKGROUND_COLOR;
    
    [self setTitle:@"证照信息" style:(XYCustomNavigationStyleWhite) hiddenBackBtn:NO];
    
    [self.view addSubview:self.tableView];
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.backgroundColor = UIColor.clearColor;
    
    self.headerView = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(FPProfileInfoHeaderView.class) owner:nil options:nil].lastObject;
    self.tableView.tableHeaderView = self.headerView;
    
    self.headerView.titleLab.text = @"众鑫花证照信息";
    self.headerView.timeLab.text = @"最近更新日期：2111年1月11日";
    
    CGFloat height = 166.f / 295.f * (SCREEN_WIDTH - 32.f - 48.f);
    self.tableView.rowHeight = 228.f - 166.f + height;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
//    return self.dataSource.count;
    return 6;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    FPProfileInfoCell *cell;
    
    if (!cell) {
        
        cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(FPProfileInfoCell.class) owner:nil options:nil].lastObject;
    }
    
    cell.mainImgView.backgroundColor = MAIN_BLUE_COLOR;
    
    if (indexPath.row == 5) {
        
        CGFloat height = 166.f / 295.f * (SCREEN_WIDTH - 32.f - 48.f);
        [UIView setCornerForView:cell.backView withRadius:5.f bounds:CGRectMake(0.f, 0.f, SCREEN_WIDTH - 32.f, 228.f - 166.f + height) corners:(UIRectCornerBottomLeft | UIRectCornerBottomRight)];
        cell.lineView.hidden = YES;
    }
    
    return cell;
}



@end
